********************************************************************************
*
**# Table 4: Do DV Judges Make Different Decisions in VOP Cases? 
*
********************************************************************************


use "${DATA}/data_VOP.dta", clear


********************************************************************************
*
**##  Panel A
*
********************************************************************************

# d ;

preserve ;

	keep if vop_case ==1 ;

	eststo clear 	;
	local m = 1		;	

	eststo vopa_`m': 
	reghdfe guilty_case dv_judge , $hdfe_opts ;
	
		estadd ysumm			;
		estadd local cntrl "" 	;
		local m `++m'			;
						
	eststo vopa_`m': 
	reghdfe guilty_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X" 	;
		local m `++m' 			;

	eststo vopa_`m': 
	reghdfe guilty_count dv_judge , $hdfe_opts ;
	
		estadd ysumm			;
		estadd local cntrl "" 	;
		local m `++m' 			;
						
	eststo vopa_`m': 
	reghdfe guilty_count dv_judge $cntrls ,$hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X" 	;
		local m `++m'	 		;
			
	eststo vopa_`m': 
	reghdfe incarcerated_case dv_judge , $hdfe_opts ;
	
		estadd ysumm			;
		estadd local cntrl "" 	;
		local m `++m' 			;
				
	eststo vopa_`m': 			
	reghdfe incarcerated_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X"	;
		local m `++m' 			;

	eststo vopa_`m': 
	reghdfe jail_time_case dv_judge , $hdfe_opts  ;
	
		estadd ysumm 			;
		estadd local cntrl "" 	;
		local m `++m' 			;

	eststo vopa_`m': 			
	reghdfe jail_time_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X"  ;
		local m `++m' 			;


	esttab 	vopa_* using "${OUTPUT}/tab4.rtf", replace ${tab_optns} 
			keep(dv_judge) 
			scalars("cntrl Controls" "ymean Y Mean")
			title( {\b Table 4. Do DV Judges Make different Decisionsin VOP Cases? Panel A: VOP Cases});
			
restore	;	  

# d cr 

********************************************************************************
*
**## Table 4 Panel B 
*
********************************************************************************

# d ; 

eststo clear ;

local m = 1 ;

eststo vopb_`m': 
reghdfe guilty_case vop_did vop_case dv_judge , $hdfe_opts ;
	
	estadd ysumm	 		;
	estadd local cntrl	"" 	;
	local m `++m' 			;

eststo vopb_`m': 
reghdfe guilty_case vop_did vop_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m'	 		;

eststo vopb_`m': 
reghdfe guilty_count vop_did vop_case dv_judge , $hdfe_opts ;

	estadd ysumm	 		;
	estadd local cntrl	"" 	;
	local m `++m' 			;

eststo vopb_`m': 
reghdfe guilty_count vop_did vop_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m'	 		;
			
eststo vopb_`m': 
reghdfe incarcerated_case vop_did vop_case dv_judge , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"" 	;
	local m `++m'	 		;

eststo vopb_`m': 
reghdfe incarcerated_case vop_did vop_case dv_judge $cntrls , $hdfe_opts ;
		
	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m' 			;
			
eststo vopb_`m': 
reghdfe jail_time_case vop_did vop_case dv_judge , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"" 	;
	local m `++m' 			;

eststo vopb_`m': 
reghdfe jail_time_case vop_did vop_case dv_judge $cntrls , $hdfe_opts ;
	
	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m' 			;

	esttab 	vopb_* using "${OUTPUT}/tab4.rtf", append ${tab_optns} 
			keep(vop_did vop_case dv_judge) 
			scalars("cntrl Controls" "ymean Y Mean")
			title( {\b Panel B:});
		 

# d cr


********************************************************************************
*   End of File
********************************************************************************
